// 账号TAB相关接口

var datas = [{
    url: '/account/list',
    type: 'get',
    response: function () {
        return {
            code: 1,
            data: {
                total: 10,
                items: [{
                    id: 1,
                    project: '抖音往后项目',
                    id_project: 1,
                    account: '账户1',
                    project_user: '王小虎',
                    project_admin: '232',
                    id_project_admin: 2,
                    depart: '业务一部',
                    id_depart: 1,
                    is_update: 1,
                }, {
                    id: 2,
                    project: '2号项目',
                    id_project: 2,
                    account: '账户2',
                    project_user: '王小虎',
                    project_admin: '232',
                    id_project_admin: 2,
                    depart: '业务一部',
                    id_depart: 2,
                    is_update: 0,
                },
                {
                    id: 3,
                    project: '',
                    id_project: 0,
                    account: '账户3',
                    project_user: '王小虎',
                    project_admin: '',
                    id_project_admin: 2,
                    depart: '业务二部',
                    id_depart: 2,
                    is_update: 1,
                },
                {
                    id: 4,
                    project: '4号项目',
                    id_project: 4,
                    account: '账户4',
                    project_user: '王小虎',
                    project_admin: '张三',
                    id_project_admin: 2,
                    depart: '业务三部',
                    id_depart: 3,
                    is_update: 1,
                }
                ]
            }
        }
    }
},
{
    url: '/agent/list',
    type: 'get',
    response: function () {
        return {
            code: 1,
            data: {
                total: 2,
                items: [{
                    id: 1,
                    name: '授权账号A',
                    add_time: '2029-09-20',
                    update_time: '2029-09-20',
                    status: 1,
                },
                {
                    id: 2,
                    name: 'xXXXXX公司',
                    add_time: '2029-09-20',
                    update_time: '2019-09-20',
                    status: 0,
                }
                ]
            }
        }
    }
},
{
    url: '/account/config',
    type: 'post',
    response: function () {
        return {
            code: 1,
            msg: '操作成功'
        }
    }
},
{
    url: '/agent/delete',
    type: 'get',
    response: function () {
        return {
            code: 1,
            msg: '操作成功'
        }
    }
},
{
    url: '/account/sync',
    type: 'get',
    response: function (config) {
        let { time } = config.query
        let data = 0
        if ((new Date()).getTime() / 1000 - time > 5) {
            data = 1
        }
        return {
            code: 1,
            data: data, // 1同步完成，0同步中
            msg: data == 1 ? '同步完成' : '同步中'
        }
    }
},
]
module.exports = datas